package com.example.personalizededucationsystem.dto.dto;

import com.example.personalizededucationsystem.model.Assignment;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TeacherAssignmentDto {
    private Long assignmentId;
    private String title;
    private String description;
    private String deadline;

    public static TeacherAssignmentDto fromEntity(Assignment assignment) {
        TeacherAssignmentDto dto = new TeacherAssignmentDto();
        dto.setAssignmentId(assignment.getAssignmentId());
        dto.setTitle(assignment.getTitle());
        dto.setDescription(assignment.getDescription());
        dto.setDeadline(assignment.getDeadline().toString());
        return dto;
    }
}
